﻿using Fiddler;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace ProgramCat.FiddlerExtension
{
    public class GenerateCodeMgr
    {
        /// <summary>
        /// 根据session 生成对应的易语言请求代码
        /// </summary>
        /// <param name="generationMode"></param>
        /// <param name="compilingMode"></param>
        /// <param name="session"></param>
        /// <returns></returns>
        public static string GenerateCode(int generationMode, int compilingMode, Session session)
        {
            

            string code = "开发中......";
            switch (generationMode)
            {
                case 0: //网页访问
                    code = new GenerateCode_JyVisit().GenerateCode(compilingMode, session);
                    break;
                case 1: //网页访问S
                    code = new GenerateCode_JyVisitS().GenerateCode(compilingMode, session);
                    break;
                case 2: //网页访问对象
                    code = new GenerateCode_JyVisitClass().GenerateCode(compilingMode, session);
                    break;
                case 3: //鱼刺WinHttpW
                    code = new GenerateCode_YcWinHttpW().GenerateCode(compilingMode, session);
                    break;
                case 4: //鱼刺WinHttpR
                    code = new GenerateCode_YcWinHttpR().GenerateCode(compilingMode, session);
                    break;
                case 5: //鱼刺WinInet
                    code = new GenerateCode_YcWinInet().GenerateCode(compilingMode, session);
                    break;
                default:
                    break;
            }

            return code;
        }
    }
}
